package demo.impl;

import com.onlyxiahui.framework.action.dispatcher.ActionContext;
import com.onlyxiahui.framework.action.dispatcher.common.ApplyInfo;
import com.onlyxiahui.framework.action.dispatcher.extend.ActionInterceptor;
import com.onlyxiahui.framework.action.dispatcher.extend.ActionRequest;
import com.onlyxiahui.framework.action.dispatcher.extend.ActionResponse;
import com.onlyxiahui.framework.action.dispatcher.extend.ArgumentBox;

/**
 * Date 2019-01-12 12:34:09<br>
 * Description
 * 
 * @author XiaHui<br>
 * @since 1.0.0
 */

public class ServiceActionInterceptor implements ActionInterceptor {

	@Override
	public ApplyInfo previous(ActionContext actionContext, ActionRequest request, ActionResponse response, ArgumentBox argumentBox) {
		boolean approve = true;
		Object requestData = request.getData();
		if (null != requestData) {
			argumentBox.put(requestData.getClass(), requestData);
		}
		ApplyInfo applyInfo = new ApplyInfo();
		applyInfo.setApprove(approve);
		return applyInfo;
	}
}
